//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.1/xslt/JavaClass.xsl

package fms.web.action;



import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import fms.common.FieldInfo;
import fms.services.FieldService;
import fms.services.ServiceException;
import fms.services.ServiceManager;
import fms.web.form.AddfieldinfoForm;

/** 
 * MyEclipse Struts
 * Creation date: 11-26-2006
 * 
 * XDoclet definition:
 * @struts.action path="/deletefieldinfo" name="addfieldinfoForm" scope="request" validate="true"
 * @struts.action-forward name="deletefieldinfosucess" path="/deletefieldinfosucess.jsp"
 * @struts.action-forward name="deletefieldinfofai" path="/deletefieldinfofail.jsp"
 */
public class DeletefieldinfoAction extends Action {

	// --------------------------------------------------------- Instance Variables

	// --------------------------------------------------------- Methods

	/** 
	 * Method execute
	 * @param mapping
	 * @param form
	 * @param request
	 * @param response
	 * @return ActionForward
	 */
	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response) {

		String delfieldid=(String)request.getParameter("field_id");
		System.out.println(delfieldid);
		
		FieldService service = null;
		try {
			service = (FieldService) ServiceManager.getDefaultManager()
					.getService(FieldService.class);
		} catch (ServiceException e) {

			e.printStackTrace();
		}
		
		try {
			service.deleteField(delfieldid);
		} catch (ServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return mapping.findForward("deletefieldinfosucess");
	}

}

